<%@ include file="/html/common/init.jsp" %>

<%@page import="com.liferay.portal.model.Country"%>
<%@page import="com.liferay.portal.model.Region"%>
<%@page import="com.liferay.portal.service.CountryServiceUtil"%>
<%@page import="com.liferay.portal.service.RegionServiceUtil"%>

<%
	GeoLocation location = (GeoLocation)portletSession.getAttribute("LIFERAY_SHARED_CURRENT_LOCATION", PortletSession.APPLICATION_SCOPE);

	PortletURL redirectURL = renderResponse.createRenderURL();
	redirectURL.setParameter("jspPage", "/html/verifycontact/step1.jsp");
	
	PortletURL updateContactURL = renderResponse.createActionURL();
	updateContactURL.setParameter(ActionRequest.ACTION_NAME, "saveLocationInfo");
	updateContactURL.setParameter("redirectURL", redirectURL.toString());
%>

Dear Customer,<br/><br/>

You are currently accessing student.com from <b><%= Validator.isNotNull(location) ? location.getFormattedText() : "Location Is Null" %></b><br/><br/>

<a href="<%= updateContactURL.toString() %>">Confirm & Proceed &raquo;</a> | 
<a href="javascript:void();" onClick="javascript:showDiv();">Change &raquo;</a>

<div id="<portlet:namespace/>div2" style="display:none;">
	
	<select name="state">
		<option value="">Select State</option>
		<%
		List<Region> states = RegionServiceUtil.getRegions();
		
		for(Region state: states){
		%><option value="<%= state.getRegionId() %>"><%= state.getName()%></option><%
		}
		%>
	</select>
	
	<select name="city">
		<option value="">Select City</option>
	</select>
</div>

<script type="text/javascript">
	function showDiv() {
		document.getElementById('<portlet:namespace/>div2').style.display = 'block';
	}
</script>